/*
 * This file is part of JNA-MJ.
 *
 * Copyleft 2014 Mark Jeronimus. All Rights Reversed.
 * https://code.google.com/p/nativeaccesshooks/
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see
 * <http://www.gnu.org/licenses/>.
 */
package com.digitalmodular.nah.platform.win32;

import java.util.Arrays;
import java.util.List;

import com.sun.jna.Structure;
import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR;
import com.sun.jna.platform.win32.WinUser;

/**
 * An extension for JNA's {@link WinUser} where I just added some stuff that I needed at some point.
 *
 * @author Mark Jeronimus
 * @since 1.0
 */
// date 2014-09-20
public interface WinUserMJ extends WinUser {
	public static final int	WH_SHELL	= 10;

	// Mouse Input Notifications
	public static final int	MOUSEMOVE	= 0x0200;
	public static final int	LBUTTONDOWN	= 0x0201;
	public static final int	LBUTTONUP	= 0x0202;
	public static final int	RBUTTONDOWN	= 0x0204;
	public static final int	RBUTTONUP	= 0x0205;
	public static final int	MBUTTONDOWN	= 0x0207;
	public static final int	MBUTTONUP	= 0x0208;
	public static final int	MOUSEWHEEL	= 0x020A;
	public static final int	XBUTTONDOWN	= 0x020B;
	public static final int	XBUTTONUP	= 0x020C;
	public static final int	MOUSEHWHEEL	= 0x020E;

	public interface LowLevelMouseProc extends HOOKPROC {
		LRESULT callback(int nCode, WPARAM wParam, MSLLHOOKSTRUCT lParam);
	}

	public static class MSLLHOOKSTRUCT extends Structure {
		public static class ByReference extends MSLLHOOKSTRUCT implements Structure.ByReference {};

		public POINT		pt;
		public int			mouseData;
		public int			flags;
		public int			time;
		public ULONG_PTR	dwExtraInfo;

		@Override
		protected List<String> getFieldOrder() {
			return Arrays.asList(new String[]{"pt", "mouseData", "flags", "time", "dwExtraInfo"});
		}
	}
}
